{\rtf1\ansi\ansicpg1252\cocoartf1265
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\margl1440\margr1440\vieww32880\viewh17900\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural

\f0\fs26 \cf0 // Global variable declarations and initialization\
Semaphore retrieved = 0;\
Semaphore wrapped = 0;\
Semaphore labeled = 0;\
\
void robot1_thread()\
\{\
	while(true)\
	\{\
		retrieve_bar();\
		retrieved.up();		\
		\
		labeled.down()\
		drop_bar();\
		\}\
	\}\
\}\
\
void robot2_thread()\
\{\
	while(true)\
	\{\
		retrieved.down()\
		wrap_bar();\
		wrapped.up();\
	\}\
\}\
\
void robot3_thread()\
\{\
	while(true)\
	\{\
		wrapped.down()\
		label_bar();\
		label.up();\
	\}\
\}}